<?php
/**
 * Created by PhpStorm.
 * User: aDaddy
 * Date: 2016/7/25
 * Time: 9:55
 */

namespace App\Model\LazyCommon;

use App\Base\BaseModel;
use Symfony\Component\HttpFoundation\Request;

class UserFireWallModel extends BaseModel {

    public function getParamRequired($paramName,Request $request)
    {
        if ($request->request->has("$paramName")) {
            return $request->get("$paramName");
        }
        if ($request->query->has("$paramName")) {
            return $request->get("$paramName");
        }
        return false;
    }



    //登录认证
    public function loginApp(Request $request)
    {
        //接收手机号
        if (!$phone = $this->getParamRequired("phone",$request)) {$s = 0;$i = "请填写手机号";$d = "";}
        //接收APP传来的密码，需要进行一次MD5加密
        if (!$password = $this->getParamRequired("password",$request)) {$s = 0;$i = "请密码不能为空";$d = "";}






        return array("s"    => $s,"i"    => $i,"d"    => $d);
    }



}